extends Item
func init():
	type = config.EQUITYPE_EQUI
	attInit()
	att.cri = 0.1
	att.maxHp = 100
	name = "[color=yellow]命运硬币[/color]"
	info = "[color=yellow]见证运气的时候到了！[/color][color=red]每次攻击50%使伤害增加25%，40%使伤害减少25%，8%对敌人造成200点真伤，1.5%秒杀敌人，0.5%秒杀自己[/color]"

func _connect():
	masCha.connect("onAtkChara",self,"run")

func run(atkinfo):
	if atkinfo.atkType == Chara.AtkType.EFF:return
	var rd = sys.rndRan(1,10000)
	if rd <= 50:
		masCha.hurtChara(masCha,masCha.att.hp*2,Chara.HurtType.REAL,Chara.AtkType.EFF)
	elif rd <= 200:
		if atkinfo.hitCha != masCha:
			masCha.hurtChara(atkinfo.hitCha,atkinfo.hitCha.att.hp*2,Chara.HurtType.REAL,Chara.AtkType.EFF)
	elif rd <= 1000:
		masCha.hurtChara(atkinfo.hitCha,200,Chara.HurtType.REAL,Chara.AtkType.EFF)
	elif rd <= 5000:
		atkinfo.hurtVal *= 0.75
	else:
		atkinfo.hurtVal *= 1.25
	#.run(atkinfo)